﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Globalization;

namespace LostLib.Programs
{
	partial class PackageSource
	{
		/// <summary>
		/// A constant indicating package source that have never been updated.
		/// </summary>
		public static readonly DateTime Never = new DateTime(2008, 1, 1);

		/// <summary>
		/// Gets PackageSource's string representation.
		/// </summary>
		/// <returns>String representation of PackageSource</returns>
		public override string ToString()
		{
			return Version == Never
				? string.Format(CultureInfo.InvariantCulture, "{0} = {1}", Name, Uri)
				: string.Format(CultureInfo.InvariantCulture, "{0}[{1}] = {2}", Name, Version.ToShortDateString(), Uri);
		}
	}
}
